<template>
  <div>
    <div id="div3">
      <el-table
          :data="tableData1"
          border
          style="width: 81.7%">

        <el-table-column
            label="用户"
            prop="uname"
            width="250">
        </el-table-column>
        <el-table-column
            prop="cstatue"
            label="车位费缴费"
            width="250">
          <template  #default="scope">
            {{scope.row.cstatue == '1' ? "未申请" : scope.row.cstatue == '2' ? "未缴费":
              scope.row.cstatue == '3' ? "已缴费" :''}}
          </template>
        </el-table-column>
        <el-table-column
            prop="hstatue"
            label="物业费缴费"
            width="250">
          <template  #default="scope">
            {{scope.row.hstatue == '1' ? "未缴费" : scope.row.hstatue== '3' ? "已缴费" :''}}
          </template>
        </el-table-column>
        <el-table-column
            label="操作"
            width="300">
          <template #default="scope">
            <el-button @click="changestatues(scope.row)">重置状态</el-button>
          </template>
        </el-table-column>
      </el-table>

    </div>
  </div>
</template>



<script>
import request from "@/utils/request";
import router from "@/router";


export default {
  name: "UserExpense",
  data(){
    return{
      id:'',
      changeInfo: false,
      AfterSale:[
      ],
      orderInfo1:false,
      orderInfo2:false,
      tableData1: [],
      tableData2:{
        name:'',
        place:'',
        telephone:'',
        account:'',
        password:'',
      },
      registeredForm: {
        name: '',
        account: '',
        tele: '',
        defaultTradePlace: '',
        password: ''
      },
    }
  },
  methods:{
    showexpense(){
      request.get("http://localhost:8081/seller/showexpense").then(res => {
        if (res.flag) {
          this.tableData1 = res.data;
          console.log("1",this.tableData1)
          this.$message({
            type: 'success',
            message: res.msg
          })
        } else {
          this.$message.error(res.msg);
        }
      })
    },
    changestatues(row){
      this.id=row.id
      request.get("http://localhost:8081/seller/changestatues?id="+this.id).then(res => {
        if (res.flag) {
          this.$message({
            type: 'success',
            message: res.msg
          })
        } else {
          this.$message.error(res.msg);
        }
      })
    },

    open() {
      this.changeInfo = true;
    },
    change(){
      this.changeInfo = false;
    },
    open1(row) {
      this.orderInfo1=true;
    },
    close1() {
      this.orderInfo1 = false;
    },
  },
  created() {
    this.showexpense()
  },
}
</script>

<style scoped>

</style>
